      SUBROUTINE UNIVEC(VEC)
C
C  UNIVEC TRANSFORMS ANY VECTOR INTO A UNIT VECTOR IN SAME DIRECTION
C
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION VEC(3)
      VECMAG=DSQRT(VEC(1)**2+VEC(2)**2+VEC(3)**2)
      DO 1 I=1,3
    1 VEC(I)=VEC(I)/VECMAG
      RETURN
      END
